package tables;

import java.sql.Date;

public class Reservation implements Tables_SUPER {

	private int id_groupePers;
	private String code_batiment;
	private int numero_salle;
	private String libelle_plage_semaine;
	private String libelle_plage_horaire;
	private Date date_resa;
	private int jour_semaine;
	
	public Reservation(int id_groupePers, String code_batiment,
			int numero_salle, String libelle_plage_semaine,
			String libelle_plage_horaire, Date date_resa, int jour_semaine) {
		this.id_groupePers = id_groupePers;
		this.code_batiment = code_batiment;
		this.numero_salle = numero_salle;
		this.libelle_plage_semaine = libelle_plage_semaine;
		this.libelle_plage_horaire = libelle_plage_horaire;
		this.date_resa = date_resa;
		this.jour_semaine = jour_semaine;
	}
	
	@Override
	public String insert() {
		java.util.Date today = new java.util.Date();
		java.sql.Date dateJour = new java.sql.Date(today.getTime());
		
		return "INSERT INTO RESERVATION VALUES("+id_groupePers+",'"+code_batiment+"',"+numero_salle+",'"+libelle_plage_semaine+"','"+libelle_plage_horaire+"',TO_DATE('"+dateJour+"','YYYY-MM-DD'),"+jour_semaine+")";
	}
	@Override
	public String update() {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	public String delete() {
		return "DELETE FROM RESERVATION WHERE CODE_BATIMENT = '"+code_batiment+"'";
	}

	//getter & setter
	public int getId_groupePers() {
		return id_groupePers;
	}

	public void setId_groupePers(int id_groupePers) {
		this.id_groupePers = id_groupePers;
	}

	public String getCode_batiment() {
		return code_batiment;
	}

	public void setCode_batiment(String code_batiment) {
		this.code_batiment = code_batiment;
	}

	public int getNumero_salle() {
		return numero_salle;
	}

	public void setNumero_salle(int numero_salle) {
		this.numero_salle = numero_salle;
	}

	public String getLibelle_plage_semaine() {
		return libelle_plage_semaine;
	}

	public void setLibelle_plage_semaine(String libelle_plage_semaine) {
		this.libelle_plage_semaine = libelle_plage_semaine;
	}

	public String getLibelle_plage_horaire() {
		return libelle_plage_horaire;
	}

	public void setLibelle_plage_horaire(String libelle_plage_horaire) {
		this.libelle_plage_horaire = libelle_plage_horaire;
	}

	public Date getDate_resa() {
		return date_resa;
	}

	public void setDate_resa(Date date_resa) {
		this.date_resa = date_resa;
	}

	public int getJour_semaine() {
		return jour_semaine;
	}

	public void setJour_semaine(int jour_semaine) {
		this.jour_semaine = jour_semaine;
	}
	
	
	
}
